package util;

/**
 * @author yuqi<307530884@qq.com> <2017/3/27>
 * @version 1.0
 * @since 1.0
 */
public final class Timer {

    private static final ThreadLocal<Long> timer = new ThreadLocal() ;

    public static void begin(){
        timer.set(System.currentTimeMillis());
    }

    public static void end(String name){
        long time = System.currentTimeMillis() - timer.get();

        System.out.println(name + " 用时:" + time + "ms");
    }

}
